import pygame
from pygame.locals import *
import sys

import state
import obj

SCREEN_W = 640
SCREEN_H = 480

class Engine:
    def __init__(self):
        pygame.init()
        screen = pygame.display.set_mode((SCREEN_W, SCREEN_H))
        pygame.display.set_caption("Jarlsberg&Cheddar")
        self.objects = []
        #Main loop
        st = state.State()
        objct = obj.Obj()
        st.object_list.append(objct)

        #Add a status stack...

        while True:
            for event in pygame.event.get():
                #--> Event hook for environment
                st.process()
                #--> Event hook for objects
                #--> Render for environment
                st.render()
                for o in st.object_list:
                    #Replace with callback
                    o.render()
                #--> Render for each object
                if event.type == pygame.QUIT:
                    sys.exit()

if __name__ == "__main__":
    engine = Engine()


